package com.demo.design;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

/**
 * @Author: chenchen19
 * @Description
 */

public class EngineController {
    private Logger logger = LoggerFactory.getLogger(EngineController.class);

    public String process(final String userId,final String userSex,final int userAge) {

        logger.info("ifelse实现方式判断用户结果。userId:{},userSex:{},userAge:{}",userId,userSex,userAge);

        if("man".equals(userSex)) {
            if(userAge < 25) {
                return "果实A";
            } else if (userAge >= 25) {
                return "果实B";
            }
        } else if ("woman".equals(userSex)) {
            if(userAge < 25) {
                return "果实C";
            } else if (userAge >= 25) {
                return "果实D";
            }
        }

        return null;
    }

}
